<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 3、求出1000-9999之间的 4 叶玫瑰数
        // 例如：1634 == 1 * 1 * 1 * 1  +  6 * 6 * 6 * 6  + 3 * 3 * 3 * 3  + 4 * 4 * 4 * 4 
        for (var i = 1000 ; i <= 9999 ; i++) {
            var qw = parseInt(i / 1000 )
            var bw = parseInt(i % 1000 / 100)
            var sw = parseInt(i % 100 / 10)
            var gw = i % 10
            if(qw*qw*qw*qw + bw*bw*bw*bw + sw*sw*sw*sw + gw*gw*gw*gw == i){
                console.log(i)
            }
        }
    </script>
</body>
</html>